package com.blb.zy_community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 楼栋 
 * </p>
 *
 * @author 二组
 * @since 2023-06-18
 */
@TableName("zy_building")

public class ZyBuilding implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 楼栋id
     *
     * 数据发送到前端可能会太长发生数据截断的问题（javaScript的问题）
     * 加一个 @JsonSerialize(using = ToStringSerializer.class) 注解可以解决
     */

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.AUTO)
    private Long buildingId;

    /**
     * 楼栋名称
     */
    private String buildingName;

    /**
     * 楼栋编码
     */
    private String buildingCode;

    /**
     * 楼栋面积
     */
    private BigDecimal buildingAcreage;

    /**
     * 小区id
     */
    @JsonSerialize(using = ToStringSerializer.class)

    private Long communityId;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private List<ZyUnit>  children;

    public List<ZyUnit> getChildren() {
        return children;
    }

    public void setChildren(List<ZyUnit> children) {
        this.children = children;
    }

    @TableField(exist = false)
    private ZyCommunity zyCommunity;

    public ZyCommunity getZyCommunity() {
        return zyCommunity;
    }

    public void setZyCommunity(ZyCommunity zyCommunity) {
        this.zyCommunity = zyCommunity;
    }

    public Long getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(Long buildingId) {
        this.buildingId = buildingId;
    }

    public String getBuildingName() {
        return buildingName;
    }

    public void setBuildingName(String buildingName) {
        this.buildingName = buildingName;
    }

    public String getBuildingCode() {
        return buildingCode;
    }

    public void setBuildingCode(String buildingCode) {
        this.buildingCode = buildingCode;
    }

    public BigDecimal getBuildingAcreage() {
        return buildingAcreage;
    }

    public void setBuildingAcreage(BigDecimal buildingAcreage) {
        this.buildingAcreage = buildingAcreage;
    }

    public Long getCommunityId() {
        return communityId;
    }

    public void setCommunityId(Long communityId) {
        this.communityId = communityId;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "ZyBuilding{" +
                "buildingId=" + buildingId +
                ", buildingName='" + buildingName + '\'' +
                ", buildingCode='" + buildingCode + '\'' +
                ", buildingAcreage=" + buildingAcreage +
                ", communityId=" + communityId +
                ", createBy='" + createBy + '\'' +
                ", createTime=" + createTime +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime=" + updateTime +
                ", remark='" + remark + '\'' +
                ", children=" + children +
                ", zyCommunity=" + zyCommunity +
                '}';
    }
}
